@echo off

if exist "%~dp0bin" rd /q /s "%~dp0bin"
if exist "%~dp0obj" rd /q /s "%~dp0obj"
call "%~dp0ParserGenerator.gencode.bat"
msbuild /p:Configuration=Release "%~dp0ParserGenerator.csproj"
copy /y "%~dp0bin\Release\pg.exe" "%~dp0..\stage"
dotnet publish -c Release "%~dp0ParserGenerator.dotnetcore.csproj"
copy /y "%~dp0bin\Release\netcoreapp2.0\publish\pg.dll" "%~dp0..\stage"
copy /y "%~dp0bin\Release\netcoreapp2.0\publish\pg.runtimeconfig.json" "%~dp0..\stage"
if exist "%~dp0bin" rd /q /s "%~dp0bin"
if exist "%~dp0obj" rd /q /s "%~dp0obj"
REM pause
